import httpInstance from "@/utils/http";

export function addQuotationApi(quotation) {
    return httpInstance({
        url: "/quotation/add",
        method: "put",
        data: quotation
    })
}

export function getPagedQuotationApi(page, size, flag, key) {
    return httpInstance({
        url: "/quotation/get/" + page + '/' + size + '?flag=' + flag + '&key=' + key,
        method: "get",
    })
}

export function getDtoByDoi(doi) {
    return httpInstance({
        url: "/quotation/getDtoByDoi?doi=" + encodeURIComponent(doi),
        method: "get",
    })
}

export function updateQuotationApi(quo) {
    return httpInstance({
        url: "/quotation/update/",
        method: "post",
        data: quo,
    })
}

export function updateQuotationAuthorsStrApi(qid) {
    return httpInstance({
        url: "/quotation/reInitAuthorsNameByQid/" + qid,
        method: "post",
    })
}

export function addDocQuoApi(id1, id2) {
    return httpInstance({
        url: "/document/quotation/add/" + id1 + '/' + id2,
        method: "put",
    })
}

export function delDocQuoApi(id1, id2) {
    return httpInstance({
        url: "/document/quotation/delete/" + id1 + '/' + id2,
        method: "delete",
    })
}
